function [drak,gray,brig] = fuzzy_inf(Intensity)
  if(Intensity <= 0.27) drak = double(1); 
  elseif(Intensity >= 0.5) drak = double(0);
  else drak = (0.5 - double(Intensity))/(0.22);
  end    
  if(Intensity >= 0.72) brig = double(1); 
  elseif(Intensity <= 0.5) brig = double(0);   
  else brig = double((double(Intensity) - 0.5)/0.22);
  end
  if(Intensity >= 0.72) gray = double(0); 
  elseif(Intensity <= 0.27) gray = double(0);
  elseif(Intensity <= 0.5) gray = double((double(Intensity) - 0.27)/0.22);
  else gray = double((0.72 - double(Intensity))/0.22);
  end
end